
/*
 *@author zg created
 *
 *
 *
 */

#include "thread_pool.h"

int pwdCommand(task_t * task)
{
    printf("execute pwd command.\n");
    //char* cwd = getcwd(NULL, 0);
    //ERROR_CHECK(cwd, NULL, "getcwd");
    char cwd[128] = {0};

    int uid;
    int path_id;
    //获取当前目录的id, 和用户id
    mysql_select_pwd(task->sp, task->name, &uid, &path_id);

    get_pwd(task->sp, path_id, uid, cwd);
    sprintf(cwd, "%s$", cwd);
    sendn(task->peerfd, cwd, strlen(cwd));

    return 0;
}
